All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.OverlayLayout

java.lang.Object
   |
   +----com.sun.java.swing.OverlayLayout

public class OverlayLayout
extends Object
implements LayoutManager2, Serializable
A layout manager to arrange components over the top of each other. The requested size of the container will be the largest requested size of the children, taking alignment needs into consideration. The alignment is based upon what is needed to properly fit the children in the allocation area. The children will be placed such that their alignment points are all on top of each other.

Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.


Constructor Index

 o OverlayLayout(Container)
Constructs a layout manager that performs overlay arrangment of the children.

Method Index

 o addLayoutComponent(Component, Object)
Adds the specified component to the layout, using the specified constraint object.
 o addLayoutComponent(String, Component)
Adds the specified component to the layout.
 o getLayoutAlignmentX(Container)
Returns the alignment along the x axis for the container.
 o getLayoutAlignmentY(Container)
Returns the alignment along the y axis for the container.
 o invalidateLayout(Container)
Indicates a child has changed its layout related information, which causes any cached calculations to be flushed.
 o layoutContainer(Container)
Called by the AWT when the specified container needs to be laid out.
 o maximumLayoutSize(Container)
Returns the minimum dimensions needed to lay out the components contained in the specified target container.
 o minimumLayoutSize(Container)
Returns the minimum dimensions needed to lay out the components contained in the specified target container.
 o preferredLayoutSize(Container)
Returns the preferred dimensions for this layout given the components in the specified target container.
 o removeLayoutComponent(Component)
Removes the specified component from the layout.

Constructors

 o OverlayLayout
 public OverlayLayout(Container target)
Constructs a layout manager that performs overlay arrangment of the children. The layout manager created is dedicated to the given container.

Parameters:
target - The container to do layout against.

Methods

 o invalidateLayout
 public void invalidateLayout(Container target)
Indicates a child has changed its layout related information, which causes any cached calculations to be flushed.

Parameters:
target - the container
 o addLayoutComponent
 public void addLayoutComponent(String name,
                                Component comp)
Adds the specified component to the layout. Not used by this class.

Parameters:
name - the name of the component
comp - the the component to be added
 o removeLayoutComponent
 public void removeLayoutComponent(Component comp)
Removes the specified component from the layout. Not used by this class.

Parameters:
comp - the component to remove
 o addLayoutComponent
 public void addLayoutComponent(Component comp,
                                Object constraints)
Adds the specified component to the layout, using the specified constraint object.

Parameters:
comp - the component to be added
constraints - where/how the component is added to the layout.
 o preferredLayoutSize
 public Dimension preferredLayoutSize(Container target)
Returns the preferred dimensions for this layout given the components in the specified target container. Recomputes the layout if it has been invalidated. Factors in the current inset setting returned by getInsets().

Parameters:
target - the component which needs to be laid out
Returns:
a Dimension object containing the preferred dimensions
See Also:
target, minimumLayoutSize
 o minimumLayoutSize
 public Dimension minimumLayoutSize(Container target)
Returns the minimum dimensions needed to lay out the components contained in the specified target container. Recomputes the layout if it has been invalidated, and factors in the current inset setting.

Parameters:
target - the component which needs to be laid out
Returns:
a Dimension object containing the minimum dimensions
See Also:
preferredLayoutSize
 o maximumLayoutSize
 public Dimension maximumLayoutSize(Container target)
Returns the minimum dimensions needed to lay out the components contained in the specified target container. Recomputes the layout if it has been invalidated, and factors in the inset setting returned by getInset().

Parameters:
target - the component which needs to be laid out
Returns:
a Dimension object containing the maximum dimensions
See Also:
preferredLayoutSize
 o getLayoutAlignmentX
 public float getLayoutAlignmentX(Container target)
Returns the alignment along the x axis for the container. If the major axis of the box is the x axis the default alignment will be returned, otherwise the alignment needed to place the children along the x axis will be returned.

Parameters:
target - the container
Returns:
the alignment >= 0.0f && <= 1.0f
 o getLayoutAlignmentY
 public float getLayoutAlignmentY(Container target)
Returns the alignment along the y axis for the container. If the major axis of the box is the y axis the default alignment will be returned, otherwise the alignment needed to place the children along the y axis will be returned.

Parameters:
target - the container
Returns:
the alignment >= 0.0f && <= 1.0f
 o layoutContainer
 public void layoutContainer(Container target)
Called by the AWT when the specified container needs to be laid out.

Parameters:
target - the container to lay out
Throws: AWTError
if the target isn't the container specified to the BoxLayout constructor

All Packages  Class Hierarchy  This Package  Previous  Next  Index